package com.quanyan.place.thread;

import com.quanyan.common.constants.Constants;
import com.quanyan.common.utils.CommonUtils;
import com.quanyan.common.utils.DateTimeUtils;
import com.quanyan.common.utils.DateUtils;
import com.quanyan.place.constants.PlaceConstants;
import com.quanyan.place.entity.TbBizPlaceUnitSalePlan;
import com.quanyan.place.entity.TbBizPlaceUnitSalePlanExample;
import com.quanyan.place.entity.TbBizPlaceUnitSalePlanMain;
import com.quanyan.place.mapper.TbBizPlaceUnitSalePlanMapper;
import com.quanyan.place.mapper.VPlaceMapper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

/**
 * Created by yangyun on 16-6-22.
 */
public class UpdateSalePlanThread implements Runnable{

    private TbBizPlaceUnitSalePlanMain unitSalePlanMain;

    private VPlaceMapper vPlaceMapper;

    private Logger logger = LoggerFactory.getLogger(UpdateSalePlanThread.class);

    public UpdateSalePlanThread(TbBizPlaceUnitSalePlanMain unitSalePlanMain,
                                VPlaceMapper vPlaceMapper){
        this.unitSalePlanMain = unitSalePlanMain;
        this.vPlaceMapper = vPlaceMapper;
    }

    @Override
    public void run() {
        int result = vPlaceMapper.updateSalePlanByTempleateId(unitSalePlanMain);
        if (result > 0){
            logger.info("修改价格成功 mainId =" + unitSalePlanMain.getId());
        } else {
            logger.info("修改价格失败 mainId =" + unitSalePlanMain.getId());
        }

    }

}
